class Stack():
    data = []

    def __init__(self, data):
        self.data = data

    def push(self, data):
        self.data.append(data)

    def pop(self):
        return self.data.pop()


class Queue():
    data = []

    def __init__(self, data):
        self.data = data

    def push(self, data):
        self.data.append(data)

    def pop(self):
        return self.data.pop(0)


s = Stack([1, 2, 3])
s.push(4)
print(s.pop())
print(s.pop())
print(s.pop())
print(s.pop())

q = Queue([1, 2, 3])
q.push(4)
print(q.pop())
print(q.pop())
print(q.pop())
print(q.pop())
